<?php

	require("header.php");
	require("table_des_matieres.php");

?>

	<fieldset style="text-align:center;">
	<legend><?php echo $language[$_SESSION['lang']]["Quicksearch"]; ?></legend>
	<form method="GET" action="locations.php">
	
	<select name="pays">
	<option value="0"><?php echo $language[$_SESSION['lang']]["Country"]; ?></option>

	<?php
	
		$selectablecountries = GetActiveCountries($connexion);
	
		foreach($selectablecountries as $country)
		{
			echo '<option value="'.$country.'">'.$country.'</option>';
		}

	?>
	</select>

	|

	<select name="cat">
	<option value="0"><?php echo $language[$_SESSION['lang']]["Category"]; ?></option>

	<?php

		$selectablecategories = GetActiveCategories($connexion);
	
		foreach($selectablecategories as $category)
		{
			echo '<option value="'.$category.'">'.$category.'</option>';
		}

	?>

	</select>

	| <?php echo $language[$_SESSION['lang']]["Numberpeople"]; ?> : <input type="text" maxlength="3" name="nbpers" value="" size="1" />
	| <?php echo $language[$_SESSION['lang']]["Price"]; ?> : <?php echo $language[$_SESSION['lang']]["From"]; ?> <input type="text" maxlength="5" name="prixmin" value="" size="3" />€ <?php echo $language[$_SESSION['lang']]["To"]; ?> <input type="text" maxlength="5" name="prixmax" value="" size="3" />€ <input type="submit" name="tri" value="<?php echo $language[$_SESSION['lang']]["Search"]; ?>" /> 
	
	</form>
	</fieldset>
	
	<fieldset>
	<legend><?php echo $language[$_SESSION['lang']]["Result"]; ?></legend>
	<?php

	if (count($locations) > 0)
	{
		foreach($locations as $location)
		{
			
			echo getLocationFieldset($location,$language);
		}
	}
	else
	{
		echo '<div style="text-align:center;">'.$language[$_SESSION['lang']]["Nolocations"].'</div>';
	}
	?>
	
	</fieldset>
	
	<div style="float:left; width:100%; text-align:center;">
	<?php
	
		echo "	<fieldset>
					<legend>".$language[$_SESSION['lang']]["Navigate"]."</legend>";
		echo $previousNext['previous_page_text']."	Page ".$_SESSION['page']." ".$language[$_SESSION['lang']]["Of"]." ".$Nbpages.$previousNext['next_page_text']."
				</fieldset>";
	
	?>
	
	</div>

<?php

	require("footer.php");

?>
